package com.think.oauth.user.qh.cas;

import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

public class HttpRequestUtils {
	public static String doGet(String urlStr) throws IOException {
		URL url = new URL(urlStr);
		InputStream in = null;
		HttpURLConnection conn = null;
		try {
			conn = (HttpURLConnection) url.openConnection();
			conn.setConnectTimeout(Constants.CONNECT_TIMEOUT);
			conn.connect();
			in = conn.getInputStream();
			return IOUtils.toString(in, Constants.UTF_8);
		} finally {
			IOUtils.close(conn);
			IOUtils.closeQuietly(in);
		}
	}
}
